  <h2>The different source code files for the stack </h2>
  The
  actual TCP/IP stack and the driver for the ethernet chip consists
  of the following files:<br>

  <ul>
    <li>enc28j60.c</li>

    <li>enc28j60.h</li>

    <li>ip_arp_udp_tcp.c</li>

    <li>ip_arp_udp_tcp.h</li>

    <li>ip_config.h</li>

    <li>timeout.h</li>

    <li>net.h</li>
  </ul>The main file you have to interface from an application
  point of view is ip_arp_udp_tcp.h. The ip_config.h allows you to
  customize the stack and switch off features that you might not
  need. This will keep the size always to the minimal. It is
  recommended to use the Makefile for compiling the files and thus
  keep track of the dependencies. Windows users might want to
  customize winmake.bat which will then call the Makefile.<br>
  <br>
  The files websrv_help_functions.c and websrv_help_functions.h contain
  useful helper function for parsing URLs or for
  URL-encoding/decoding.<br>
  <br>
  <h2>DNS and DHCP </h2>
  The files dnslkup.c and dnslkup.h implement a tiny but very 
  capable DNS resolver.
  <br>
  <br>
  The DHCP client is: dhcp_client.c and dhcp_client.h

  <h2>Examples on how to use the stack</h2>
  
  <ul>
  <li><a href=client-tuxgr-email>client-tuxgr-email</a>
  <li><a href=client-www>client-www</a>
  <li><a href=client-www-dhcp>client-www-dhcp</a>
  <li><a href=server-www-remswitch>server-www-remswitch</a>
  <li><a href=server-www-simple>server-www-simple</a>
  </ul>

The different examples and applications in this package are:
<br>

<ul>
<li>server-www-simple/test_OKworks.c -- Example for a basic web server<br><br>
<li>server-www-simple/basic_web_server.c -- Example for a web server<br><br>
<li>server-www-simple/test_readSiliconRev.c -- Prints the chip revision of the ENC<br><br>
<li>server-www-remswitch/main.c -- You can switch a relay  on or off a relay via a web-page or via a small udp application (see directory udpcom). The relay is connected via pin PD7. The default password is "secret".<br><br>
<li>client-tuxgr-email/test_emailnotify.c -- send email notifications when you connect PD6 to GND. You need a tuxgraphics microcontroller mail account to use this. There is a timeout of 3min to prevent too many mails.<br><br>
<li>client-www/test_identi_ca.c -- post a message on identi.ca. To trigger the sending of the message connect PD6 to GND. You need a identi.ca account to use this. There is a timeout of 3min to prevent too many posts.<br><br>
<li>client-www/test_web_client.c -- a web client that uploads data to <a href=http://tuxgraphics.org/cgi-bin/upld>http://tuxgraphics.org/cgi-bin/upld</a> when you ping it once (you can ping it again after 60sec and it will do a new upload).<br><br>
<li>client-www-dhcp/test_dhcp_www_client_pushbutton.c -- a web client that uploads data to <a href=http://tuxgraphics.org/cgi-bin/upld>http://tuxgraphics.org/cgi-bin/upld</a> when you connect PD6 with GND for a moment. This client uses DHCP to configure its self. You can just load the software and plug it to any body's DSL router and it will work.<br><br>
<li>client-www-dhcp/test_dhcp_www_client_adc0.c -- a web client that uploads periodically (at power on and then every hour) voltage readings from ADC0 to <a href=http://tuxgraphics.org/cgi-bin/upld>http://tuxgraphics.org/cgi-bin/upld</a>  This client uses DHCP to configure its self. You can just load the software and plug it to any body's DSL router and it will work.<br><br>
</ul>
  <br>
  <h2>What are those callback functions?</h2>
  Some functions want a pointer to a function as one of the arguments.
  That function gets then called at a later point in time when some
  result is available.
  <br>
  <br>
  Why are we doing this? In a microcontroller the execution has always
  to continue (or at least you have to have the possibility to do so).
  That way you can still be responsive to other events (key button
  events, monitoring of voltages...). 
  <br>
  <br>
  The callback function gets then  automatically executed when the
  result is ready but in the mean time you could be doing something else
  if you wanted.


<pre>
//Example of a callback function:

void arpresolver_result_callback(uint8_t *ip,uint8_t transaction_number,uint8_t *mac){
        uint8_t i=0;
        if (transaction_number==TRANS_NUM_GWMAC){
                // copy mac address over:
                while(i&lt;6){gwmac[i]=mac[i];i++;}
        }
}

// a pointer to arpresolver_result_callback is passed to get_mac_with_arp():
get_mac_with_arp(gwip,TRANS_NUM_GWMAC,&amp;arpresolver_result_callback);
</pre>

  <hr>
<br>Copyright of the software and all diagrams: Guido Socher, tuxgraphics.org
<br>
<br>License for all application code: GPL V2
<br>See http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
<br>License for the stack: GPL V2
<br>See http://www.gnu.org/licenses/old-licenses/lgpl-2.0.html
<br>
<br>Other licenses are available on request.
  <hr>
vim:sw=8:ts=8:si:et
